#ifndef GAME_H_
#define GAME_H_

#define MAX_PLAYERS 4
#define NUM_OF_CARDS_IN_START_HAND 5

#include "player\include\Player.h"
#include "cards\include\Deck.h"

namespace core
{

class Game
{
public:
	Game(uint8 num_of_players, unsigned int dealer);

	void output();

	inline uint8 num_of_players() const { return mPlayersNum; }
	bool end() const;

	void deal_start_hands();
	void next_round();

	inline uint8 round() const { return mRound; }
	inline void next_player() { ++mCurrentPlayer %= 4; }
	inline int curr_player_number() const { return mCurrentPlayer; }

	inline player::Player* curr_player_ptr() const { return mCurrPlayer_ptr; }
	inline void set_curr_player_ptr() { mCurrPlayer_ptr = mPlayers + curr_player_number(); }

	void results();
	void results_output();

private:
	uint8 mPlayersNum;
	uint8 mDealer;
	
	Card mStartHand[NUM_OF_CARDS_IN_START_HAND * MAX_PLAYERS];
	player::Player mPlayers[MAX_PLAYERS];

	Deck mDeck;
	uint8 mRound;
	uint8 mCurrentPlayer;

	player::Player* mCurrPlayer_ptr;
};

} // namespace core


#endif // GAME_H_